home *** CD-ROM | disk | FTP | other *** search
/ cyber.net interactivo 5 / inter@ivo 1996-06.iso / cybint5 / bin / shared.dxr / 00900_Voodoo.ls next >
Encoding:
Text File  |  1996-05-13  |  4.0 KB  |  205 lines

  1. on initGlobals
  2.   global active
  3.   set active to 0
  4. end
  5.  
  6. on wait time
  7.   startTimer()
  8.   repeat while the timer < (time * 60)
  9.     nothing()
  10.   end repeat
  11. end
  12.  
  13. on HotSpots first, last, som, cur
  14.   set already to 0
  15.   set check to 0
  16.   set sense to first + ((last - first + 1) / 2)
  17.   set middle to sense
  18.   set hot to first
  19.   set cold to first
  20.   repeat while sense <= last
  21.     if rollOver(sense) then
  22.       if the visible of sprite hot = 1 then
  23.         set already to 1
  24.       end if
  25.       set check to 1
  26.       if (som <> 0) and (already = 0) then
  27.         sound playFile 2, som
  28.       end if
  29.       set the visible of sprite hot to 1
  30.       exit repeat
  31.     else
  32.       set the visible of sprite hot to 0
  33.     end if
  34.     set hot to hot + 1
  35.     set sense to sense + 1
  36.   end repeat
  37.   if check = 1 then
  38.     repeat while cold < middle
  39.       if cold <> hot then
  40.         set the visible of sprite cold to 0
  41.       end if
  42.       set cold to cold + 1
  43.     end repeat
  44.   else
  45.     if cur <> 0 then
  46.     else
  47.       cursor(-1)
  48.     end if
  49.   end if
  50.   if check = 1 then
  51.     return 1
  52.   else
  53.     return 0
  54.   end if
  55. end
  56.  
  57. on hotBlinks first, last, cur
  58.   set check to 0
  59.   set sense to first + ((last - first + 1) / 2)
  60.   set middle to sense
  61.   set hot to first
  62.   set cold to first
  63.   set blink to first
  64.   repeat while sense <= last
  65.     if rollOver(sense) then
  66.       set check to 1
  67.       set the visible of sprite hot to 1
  68.       exit repeat
  69.     end if
  70.     set hot to hot + 1
  71.     set sense to sense + 1
  72.   end repeat
  73.   if check = 1 then
  74.     repeat while cold < middle
  75.       if cold <> hot then
  76.         set the visible of sprite cold to 0
  77.       end if
  78.       set cold to cold + 1
  79.     end repeat
  80.   else
  81.     repeat while blink < middle
  82.       if the visible of sprite blink = 1 then
  83.         set the visible of sprite blink to 0
  84.         if blink = (middle - 1) then
  85.           set the visible of sprite first to 1
  86.         else
  87.           set the visible of sprite (blink + 1) to 1
  88.         end if
  89.         exit repeat
  90.       end if
  91.       set blink to blink + 1
  92.     end repeat
  93.     if cur <> 0 then
  94.     else
  95.       cursor(-1)
  96.     end if
  97.   end if
  98.   if check = 1 then
  99.     return 1
  100.   else
  101.     return 0
  102.   end if
  103. end
  104.  
  105. on somBlinks first, last, som, cur
  106.   global active
  107.   set local to the mouseCast
  108.   if hotBlinks(first, last, cur) = 1 then
  109.     if active = 0 then
  110.       sound playFile 2, som
  111.       set active to 1
  112.     end if
  113.     if the mouseCast <> local then
  114.       sound playFile 2, som
  115.     end if
  116.   else
  117.     set active to 0
  118.   end if
  119.   Loopframe()
  120. end
  121.  
  122. on InVis first, last
  123.   set cont to first
  124.   if last = 0 then
  125.     set the visible of sprite cont to 0
  126.   else
  127.     repeat while cont <= last
  128.       set the visible of sprite cont to 0
  129.       set cont to cont + 1
  130.     end repeat
  131.   end if
  132. end
  133.  
  134. on onVis first, last
  135.   set cont to first
  136.   if last = 0 then
  137.     set the visible of sprite cont to 1
  138.   else
  139.     repeat while cont <= last
  140.       set the visible of sprite cont to 1
  141.       set cont to cont + 1
  142.     end repeat
  143.   end if
  144. end
  145.  
  146. on Loopframe
  147.   updateStage()
  148.   go(the frame)
  149. end
  150.  
  151. on videoButton vidsprite, vidframe
  152.   sound stop 1
  153.   sound stop 2
  154.   set the visible of sprite vidsprite to 1
  155.   go(vidframe)
  156. end
  157.  
  158. on videoInit vidsprite, vidcast
  159.   set the startTime of sprite vidsprite to 0
  160.   set the sound of cast vidcast to 1
  161. end
  162.  
  163. on videoLoop vidsprite, vidcast
  164.   if the movieTime of sprite vidsprite = the duration of cast vidcast then
  165.     set the sound of cast vidcast to 0
  166.     set the visible of sprite vidsprite to 0
  167.     updateStage()
  168.     go(the frame + 1)
  169.   else
  170.     go(the frame)
  171.   end if
  172. end
  173.  
  174. on videoClick vidsprite, vidcast
  175.   set the sound of cast vidcast to 0
  176.   set the visible of sprite vidsprite to 0
  177.   updateStage()
  178.   go(the frame + 1)
  179. end
  180.  
  181. on videoExit backframe
  182.   updateStage()
  183.   go(backframe)
  184. end
  185.  
  186. on startNext first, last
  187.   global present
  188.   set the visible of sprite first to 1
  189.   set present to first
  190. end
  191.  
  192. on next
  193.   global present
  194.   set present to present + 1
  195.   set the visible of sprite present to 1
  196. end
  197.  
  198. on checkVis checked
  199.   if the visible of sprite checked = 1 then
  200.     return 1
  201.   else
  202.     return 0
  203.   end if
  204. end
  205.